﻿@{
    var uo = new DiaosFix.Core.UsersOperator();
}

@if (Request.IsAuthenticated)
{
    <ul id="menu">
        <li>@Html.ActionLink("Welcome", "Index", "Home")</li>
        @if (uo.FindUser(User.Identity.Name).IsSuccess)
        {
            if (uo.IsInRole(User.Identity.Name, DiaosFix.Core.PubConstant.UserTypes.Admin))
            {
                <li>@Html.ActionLink("Create A Diaos", "About", "Home")</li>
                <li>@Html.ActionLink("Diaos Management", "About", "Home")</li>
                <li>@Html.ActionLink("Membership Management", "About", "Home")</li>
            }

            if (uo.IsInRole(User.Identity.Name, DiaosFix.Core.PubConstant.UserTypes.Diaos))
            {
                <li>@Html.ActionLink("All Requests", "AllRequests", "Request")</li>
                <li>@Html.ActionLink("Assigned To Me", "AssignedToMe", "Request")</li>
            }

            if (uo.IsInRole(User.Identity.Name, DiaosFix.Core.PubConstant.UserTypes.User))
            {
                <li>@Html.ActionLink("Raise a Request", "Raise", "Request")</li>
                <li>@Html.ActionLink("My Open Requests", "MyOpenRequests", "Request")</li>
                <li>@Html.ActionLink("My Closed Requests", "MyClosedRequests", "Request")</li> 
            }
        }
        <li>@Html.ActionLink("How To Use", "Manual", "Home")</li>
        <li>@Html.ActionLink("About", "About", "Home")</li>
    </ul>
}
else
{
    <ul id="menu">
        <li>@Html.ActionLink("Welcome", "Index", "Home")</li>
        <li>@Html.ActionLink("How To Use", "Manual", "Home")</li>
        <li>@Html.ActionLink("About", "About", "Home")</li>
    </ul>
}
